﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace caufingHealth.Forms
{
    public partial class LabTestForm : Form
    {
        public enum MODE { UPDATE, NEW };
        public int labID
        {
            get;
            private set;
        }

        public int labResult
        {
            get;
            private set;
        }

        public int DoctorID
        {
            get;
            private set;
        }

        public LabTestForm()
        {
            InitializeComponent();
            
        }

        public LabTestForm(LabTestInformation[] labs, DoctorInformation[] doctors) : this()
        {
            cb_TestName.DataSource = labs;
            cb_TestName.SelectedIndex = 0;
            cb_Doctor.DataSource = doctors;
            cb_Doctor.SelectedIndex = 0;
            cb_Result.SelectedIndex = 0;
        }

        public LabTestForm(int doctorID, string testID, string result, LabTestInformation[] labs, DoctorInformation[] doctors)
            : this()
        {
            cb_TestName.DataSource = labs;
            cb_Doctor.DataSource = doctors;
            cb_TestName.SelectedItem = testID;
           // cb_TestName.SelectedText = testID;
            cb_Doctor.SelectedValue = doctorID;
            cb_Result.SelectedText = result;
            
        }

        private void btn_SubmitResult_Click(object sender, EventArgs e)
        {
            labID = (int)cb_TestName.SelectedValue;
            labResult = cb_Result.SelectedIndex;
            DoctorID = (int)cb_Doctor.SelectedValue;
        }
    }
}
